<?php
/**
 * Created by PhpStorm.
 * User: 84071
 * Date: 2017-09-07
 * Time: 11:47
 */
namespace app\common\model;
use think\Model;
class AuthGroup extends Model{


    public function allgroup(){
        if(webCacheHas('group')){
            $allgroup = webCacheGet('group');
        }else{
            $allgroup = $this->order('sort desc,id asc')->select();
            webCacheSet('group',$allgroup);
        }
        return $allgroup;
    }
    //  调用用户组显示列表
    public function grouplst($groupid = '0',$status='0'){
        $allgroup = $this->allgroup();
        if($status == '0'){
            foreach ($allgroup as $k => $v){
                if($v['status'] != '1'){
                    unset($allgroup[$k]);
                }
            }
        }
        return $allgroup;
    }

}